<script lang="ts" setup>
import useStore from '../store'

const { nav } = useStore()

// 调用store里面的方法, 将获取的数据赋值给state
nav.getList()
// 需要将选中的的项目变成红色
</script>

<template>
  <ul class="catagtory">
    <li
      :class="{ select: item.id === nav.activeID }"
      v-for="item in nav.list"
      :key="item.id"
      @click="nav.changeActiveID(item.id)"
    >
      {{ item.name }}
    </li>
  </ul>
</template>

<style scoed lang="less"></style>
